var elem = '#demo'

var spreadable = true

var checkbox = true

var layout = [
  {
    name: '菜单名称',
    treeNodes: true,
    headerClass: 'value_col',
    colClass: 'value_col',
    style: '',
  },
  { name: 'id', field: 'id', headerClass: 'value_col', colClass: 'value_col', style: '' },
  {
    name: '文本',
    field: 'text',
    headerClass: 'value_col',
    colClass: 'value_col',
    style: '',
  },
  {
    name: '操作',
    headerClass: 'value_col',
    colClass: 'value_col',
    style: 'width: 20%',
    render: function (row) {
      return (
        "<a class='layui-btn layui-btn-danger layui-btn-sm' onclick='del(" +
        row +
        ")'><i class='layui-icon'>&#xe640;</i> 删除</a>"
      ) //列渲染
    },
  },
]

var nodes = [
  {
    id: '1',
    name: '父节点1',
    text: '测试',
    checked: false,
    children: [
      {
        id: '11',
        name: '子节点11',
        text: '',
      },
      {
        id: '12',
        name: '子节点12',
        text: '',
      },
    ],
  },
  {
    id: '2',
    name: '父节点2',
    text: '',
    checked: true,
    children: [
      {
        id: '21',
        name: '子节点21',
        text: '',
        children: [
          {
            id: '211',
            name: '子节点211',
            text: '',
          },
        ],
      },
    ],
  },
  {
    id: '3',
    name: '父节点3',
    text: '',
  },
]
